package org.hutech09.jsale.web.manager.customer;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import org.hutech09.jsale.bsn.IOrderManager;
import org.hutech09.jsale.entity.Customer;
import org.hutech09.jsale.entity.POrder;

/**
 *
 * @author Nam
 */
@ManagedBean
@SessionScoped
public class OrderBrowseCtrl {

    @EJB
    private IOrderManager om;

    private Customer customer;

    private List<POrder> orders;

    private POrder selectedOrder;

    public OrderBrowseCtrl() {
    }

    public Customer getCustomer() {
        return customer;
    }

    public List<POrder> getOrders() {
        return orders;
    }

    public void setOrders(List<POrder> order) {
        this.orders = order;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
        orders = om.getOrders(customer);
        System.err.println(customer);
    }

    public POrder getSelectedOrder() {
        return selectedOrder;
    }

    public void setSelectedOrder(POrder selectedOrder) {
        this.selectedOrder = selectedOrder;
    }
}
